import numpy as np
import matplotlib.pyplot as plt

z_mat = np.array([1.67, 1.02, 2.17, 3., 3.75, 5.26, 8.31, 7.35, 8.48, 8.48, 10.41, 9.17,
                  11.12, 12.41, 14.37, 13.94, 16.68, 17.95, 19.21, 16.84, 21.58, 20.54, 21.75, 24.4,
                  25., 24.94, 25.7, 25.93, 26.99, 28.78, 31.6, 30.51, 32.28, 31.6, 32.83, 35.55,
                  35.5, 37.77, 38.5, 38.23, 39.32, 41.66, 40.97, 42.87, 44.51, 46.5, 43.14, 47.6,
                  48.34, 48.83, 51.97, 49.88, 51.89, 53.48, 54.24, 54.19, 55.69, 57.72, 57.99, 57.94,
                  60.09, 60.8, 63.79, 62.2, 63.82, 66.85, 65.92, 65.99, 67.6, 69.85, 68.55, 71.61,
                  72.82, 72.82, 73.15, 75.43, 77.92, 77.14, 78.04, 77.67, 79.84, 82.12, 81.98, 82.95,
                  84.13, 85.8, 85.11, 87.7, 87.6, 89.92, 90.03, 89.65, 90.14, 93.03, 93.68, 94.36,
                  97.43, 97.48, 99.51, 98.66])
print('z_mat:', z_mat.shape, z_mat.dtype)
d_s = np.append(z_mat[0:1], z_mat[1:] - z_mat[:-1])
d_t = 1.
v = d_s / d_t
print('mean v:', v.mean())
plt.plot(v)
plt.grid()
plt.show()
